﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using hzGis.model;
using ESRI.ArcGIS.Geodatabase;

namespace hzGis.service.impl.ydhy
{
    public class YdhyOffice
    {
        public List<FieldConn> build1(string year)
        {
            List<FieldConn> fields = new List<FieldConn>(){
                new FieldConn("bdcdyh", "bdcdyh", esriFieldType.esriFieldTypeString),
                new FieldConn("bdcqzh", "bdcqzh", esriFieldType.esriFieldTypeString),
                new FieldConn("dlmc", "dlmc"+year, esriFieldType.esriFieldTypeString),
                new FieldConn("fx_dlmc", "fxdlmc"+year, esriFieldType.esriFieldTypeString),
                new FieldConn("qlrmc", "qlrmc", esriFieldType.esriFieldTypeString),
                new FieldConn("qsxz", "qsxz", esriFieldType.esriFieldTypeString)
            };
            return fields;
        }

        public List<FieldConn> build2(string year)
        {
            List<FieldConn> fields = new List<FieldConn>(){
                new FieldConn("dlmc", "dlmc"+year, esriFieldType.esriFieldTypeString),
                new FieldConn("fx_dlmc", "fxdlmc"+year, esriFieldType.esriFieldTypeString)
            };
            return fields;
        }

        public List<FieldConn> build3(string year)
        {
            List<FieldConn> fields = new List<FieldConn>(){
                new FieldConn("DLMC", "dlmc"+year, esriFieldType.esriFieldTypeString)
            };
            return fields;
        }

        public List<Dictionary<string, object>> buildAnalysisDatas()
        {
            List<Dictionary<string, object>> result = new List<Dictionary<string, object>>();
            // 2022年
            Dictionary<string, object> data2022 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2022\41943370880b42489361b0afcbd0bfba\SDDLNEWFX.shp"},
               {"fields", build1("2022")},
               {"year", "2022"}
            };
            result.Add(data2022);
            Dictionary<string, object> data2021 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2021\8e2c141b15974fe6abef5263f145bc70\SDDLNEWFX.shp"},
               {"fields", build2("2021")},
               {"year", "2021"}
            };
            result.Add(data2021);
            Dictionary<string, object> data2020 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2020\b05b5cbf6a9546768dc44846d058d1f2\SDDLNEWFX.shp"},
               {"fields", build2("2020")},
               {"year", "2020"}
            };
            result.Add(data2020);
            Dictionary<string, object> data2019 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2019\ed12a09ebff44f84b4840ec4707852bf\SDDLNEWFX.shp"},
               {"fields", build2("2019")},
               {"year", "2019"}
            };
            result.Add(data2019);
            Dictionary<string, object> data2018 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2018\TZHDLFX_bb136fc0111b411e86971b04726516d3.mdb&TZHDLGDFX"},
               {"fields", build3("2018")},
               {"year", "2018"}
            };
            result.Add(data2018);
            Dictionary<string, object> data2017 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2017\TZHDLFX_faf0cafcc4b0444a976677fefcfe53aa.mdb&TZHDLGDFX"},
               {"fields", build3("2017")},
               {"year", "2017"}
            };
            result.Add(data2017);
            Dictionary<string, object> data2016 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2016\TZHDLFX_0e9c64a69cdb48febc3b370d2bf620d2.mdb&TZHDLGDFX"},
               {"fields", build3("2016")},
               {"year", "2016"}
            };
            result.Add(data2016);
            Dictionary<string, object> data2015 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2015\TZHDLFX_d0b5804d10fe4b8d9d488bf17208d09d.mdb&TZHDLGDFX"},
               {"fields", build3("2015")},
               {"year", "2015"}
            };
            result.Add(data2015);
            Dictionary<string, object> data2014 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2014\TZHDLFX_a1357a7ad7f941dfbf1968b408d91e0b.mdb&TZHDLGDFX"},
               {"fields", build3("2014")},
               {"year", "2014"}
            };
            result.Add(data2014);
            Dictionary<string, object> data2013 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2013\TZHDLFX_123ae7ee247749e9a1754e9d9508c99f.mdb&TZHDLGDFX"},
               {"fields", build3("2013")},
               {"year", "2013"}
            };
            result.Add(data2013);
            Dictionary<string, object> data2012 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2012\TZHDLFX_2f85d27afd6c45c0991adbab956b7639.mdb&TZHDLGDFX"},
               {"fields", build3("2012")},
               {"year", "2012"}
            };
            result.Add(data2012);
            Dictionary<string, object> data2011 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2011\TZHDLFX_65589e28a616497ebd9d83c58826c890.mdb&TZHDLGDFX"},
               {"fields", build3("2011")},
               {"year", "2011"}
            };
            result.Add(data2011);
            Dictionary<string, object> data2010 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2010\TZHDLFX_a1f29d4fe5d7493fa1570adc2dc4fa29.mdb&TZHDLGDFX"},
               {"fields", build3("2010")},
               {"year", "2010"}
            };
            result.Add(data2010);
            Dictionary<string, object> data2009 = new Dictionary<string, object>()
            {
               {"path",@"D:\data\ydbp\test\download\2009\TZHDLFX_e5907f1533504e1089ee5a91e0d615b4.mdb&TZHDLGDFX"},
               {"fields", build3("2009")},
               {"year", "2009"}
            };
            result.Add(data2009);
            return result;
        }


        public List<Dictionary<string, string>> buildDataPaths()
        {
            List<Dictionary<string, string>> paths = new List<Dictionary<string, string>>() { 
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2022"},{"year", "2022"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2021"},{"year", "2021"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2020"},{"year", "2020"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2019"},{"year", "2019"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2018"},{"year", "2018"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2017"},{"year", "2017"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2016"},{"year", "2016"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2015"},{"year", "2015"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2014"},{"year", "2014"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2013"},{"year", "2013"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2012"},{"year", "2012"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2011"},{"year", "2011"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2010"},{"year", "2010"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\test\result\rs.gdb&tlb2009"},{"year", "2009"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2008\441322\DLTB.shp"},{"year", "2008"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2007\441322\DLTB.shp"},{"year", "2007"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2006\441322\DLTB.shp"},{"year", "2006"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2005\441322\DLTB.shp"},{"year", "2005"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2004\441322\DLTB.shp"},{"year", "2004"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2003\441322\DLTB.shp"},{"year", "2003"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2002\441322\DLTB.shp"},{"year", "2002"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2001\441322\DLTB.shp"},{"year", "2001"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\2000\441322\DLTB.shp"},{"year", "2000"}},
                new Dictionary<string, string>(){{"path",@"D:\data\ydbp\resultData\1999\441322\DLTB.shp"},{"year", "1999"}}
            };
            return paths;
        }
    }
}
